package demo3;

import java.security.spec.PSSParameterSpec;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-03-14
 * Time: 22:31
 */
class A{
    public A() {
        func();//动态绑定
    }
    public void func(){
        System.out.println("A.func()");
    }
}
class B extends A{
    private int num = 1;

    @Override
    public void func() {
        System.out.println("B.func() " + num);
    }
}
public class Test {
    public static void main(String[] args) {
        B b = new B();
    }
}
